@extends('address.index')
@section('content')
	<!-- right content start-->
		<div class="u_right fl" id="myaddr_v2">
		 	<h3 class="myaddr_tit">我的收货地址<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
  添加新地址
</button></h3>

            	<div class="myaddr_div2">
                	

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">

  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">填写新地址</h4>
      </div>
      <form action="/address/insert" method='POST'>
      <div class="modal-body">
      <!-- <form action=""> -->
        <!--导入插件-->
    <script type="text/javascript" src="/homeHTML/js/addressjquery.js"></script>
    <script type="text/javascript" src="/homeHTML/js/area.js"></script>


    <script type="text/javascript" src="/homeHTML/js/location.js"></script>
    <link rel="stylesheet" href="/homeHTML/css/common.css">
    
      收货人姓名:<input type="text" name="getman"><br>
      收货人手机:<input type="text" name="phone"><br>
      <!--层级联动选择框-->
    详细地址:&nbsp;&nbsp;&nbsp;<select id="loc_province" class="" name="sheng" style="width:80px;"></select>
    <select id="loc_city" class="" name="shi" style="width:100px;"></select>
    <select id="loc_town" class="" name="xian" style="width:120px;"></select>
    <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="jiedao">(请填写详细地址,确保准确送达)
    <br>是否设为默认
    <label><input type="radio" name="isdefault" value='1'>是</label>
    <label><input type="radio" name="isdefault" value='0'>否</label>
	
    {{csrf_field()}}
    <!-- <input type="submit" value="保存"> -->
     
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>


        <button  class="btn btn-primary">保存</button>
        <!-- <input type="submit" value="保存"> -->
      </div>
      </form>
    </div>
  </div>
</div>
                </div>
   <!-- address list start-->
	<div style="display: block;" class="myaddr_table" id="addressListDiv">
  
    <table class="myaddr_list" id="tbl_address" style="border-collapse:collapse" cellpadding="0" cellspacing="0">
      <tbody><tr class="">
        <th width="136px">收货人</th>
        <th width="150px">所在地区</th>
        <th width="200px">详细地址</th>
        <th width="142px">收货人手机</th>
        <th width="100px"></th>
        <th width="100px">操作</th>
      </tr>
	        @foreach($address as $k=>$v)
    <tr class="" id="5f7413df178b44909eded88086630f41" default="true">
      <td>{{$v->getman}}</td>
      <td class="attr" attr="{{$v->sheng}},{{$v->shi}},{{$v->xian}}"></td>
      <td>{{$v->jiedao}}</td>
      <td>{{$v->phone}}</td>
      <td><span class="cOrg"></span></td>
      <td><p class="cC0c0"><a class="edit"  href="{{url('/address/edit',$v->id)}}">修改</a >|<a class="delete" aid="{{$v->id}}" href="javascript:void(0);">删除</a></p></td>
    </tr>
    @endforeach

    </tbody>
  </table>
 
    <p class="myaddr_dialog myaddr_right" id="addr_alert" style="display: none;">设置成功</p>
</div>
<!-- address list end-->
@endsection